﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LimpaGaragem.BLL.Product
{
    public class Info
    {
        /// <summary>
        /// Get product
        /// </summary>
        public LimpaGaragem.Model.Product.Info GetProduct(int IDProduct)
        {
            try
            {
                return new LimpaGaragem.DAO.Product.Info().GetProduct(IDProduct);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Insert new user
        /// </summary>
        /// <returns>ID USER</returns>
        public int InsertProduct(string Name,
                                string Description,
                                decimal Price,
                                int IDUser,
                                int IDTransactionType,
                                int IDCategory,
                                LimpaGaragem.Model.Product.Info.EnumCondition ECondition,
                                int? IDBrand,
                                int? IDModel,
                                int? IDVersion)
        {
            try
            {
                return new LimpaGaragem.DAO.Product.Info().InsertProduct(Name,
                                                                        Description,
                                                                        Price,
                                                                        IDUser,
                                                                        IDTransactionType,
                                                                        IDCategory,
                                                                        ECondition,
                                                                        IDBrand,
                                                                        IDModel,
                                                                        IDVersion);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Alter product
        /// </summary>
        public void AlterProduct(int IDProduct,
                                string Name,
                                string Description,
                                decimal Price,
                                int IDUser,
                                int IDTransactionType,
                                int IDCategory,
                                LimpaGaragem.Model.Product.Info.EnumCondition ECondition,
                                int? IDBrand,
                                int? IDModel,
                                int? IDVersion)
        {
            try
            {
                new LimpaGaragem.DAO.Product.Info().AlterProduct(IDProduct,
                                                                Name,
                                                                Description,
                                                                Price,
                                                                IDUser,
                                                                IDTransactionType,
                                                                IDCategory,
                                                                ECondition,
                                                                IDBrand,
                                                                IDModel,
                                                                IDVersion);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Delete product
        /// </summary>
        public void DeleteProduct(int IDProduct)
        {
            try
            {
                new LimpaGaragem.DAO.Product.Info().DeleteProduct(IDProduct);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Alter password of user
        /// </summary>
        public void AlterProductStatus(int IDUser, int IDStatus)
        {
            try
            {
                new LimpaGaragem.DAO.Product.Info().AlterProductStatus(IDUser, IDStatus);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
